package com.online.service.impl;


import com.online.entity.FillQuestion;
import com.online.mapper.FillQuestionMapper;
import com.online.service.FillQuestionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class FillQuestionServiceImpl implements FillQuestionService {
    @Autowired
    private FillQuestionMapper fillQuestionMapper;
    /**
     * 增加填空题信息
     * @param fillQuestion
     * @return
     */
    @Override
    public int add(FillQuestion fillQuestion) {
        return fillQuestionMapper.add(fillQuestion);
    }
    /**
     * 查询最后一条questionId
     * @return
     */
    @Override
    public FillQuestion findOnlyQuestionId() {
        return fillQuestionMapper.findOnlyQuestionId();
    }

    @Override
    public List<FillQuestion> findByIdAndType(Integer paperId) {
        return fillQuestionMapper.findByIdAndType( paperId);
    }

    @Override
    public List<Integer> findBySubject(String subject, Integer fillNumber) {
        return fillQuestionMapper.findBySubject(subject,fillNumber);
    }
}
